import java.util.Scanner;

public class forth {

    private static  void arrLength(int [] arr, int data)
    {

        int n = 0;

        while(true)
        {
            if( arr[n] == data)
            {
                System.out.println("找到了在第" + n + "个");
                break;

            }
            else{

                n++;

            }


        }

        System.out.println("没找找");
    }
    public static void main(String[] args) {

            int arr[] = {1,2,3,4};
        System.out.println("请输入要查找的元素:");
        Scanner scanner = new Scanner(System.in);
        int data = scanner.nextInt();
         arrLength(arr, data);

            System.out.println("数组的元素个数为:");
            System.out.println(arr.length);
            System.out.println("数组元素依次为:");
            for (int i = 0;i < arr.length;i++)
            {
                System.out.print(arr[i] +" ");
            }
        }
    }

